"""AppMock URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path
from MyApp.views import *

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', project_list),
    path('project_list/', project_list),  # 项目列表页
    path('add_project/', add_project),  # 新增项目
    re_path('del_project/(?P<pid>.+)/', del_project),  # 删除列表中项目
    path('project_set/', project_set),  # 项目设置
    path('project_data/', project_data),  # 项目数据
    #######
    path('login/', login),  # 登陆页
    path('logout/', logout),  # 退出登陆
    path('sign_in/', sign_in),  # 登陆操作
    path('sign_up/', sign_up),  # 注册操作
    path('forget_pwd/', forget_pwd),  # 忘记密码
    path('send_email_code/', send_email_code),  # 发送邮件
    ##### mock
    re_path('mock_list/(?P<pid>.+)/', mock_list),  # 项目详情页
    re_path('add_mock/(?P<pid>.+)/', add_mock),  # 增加单元
    re_path('del_mock/(?P<mid>.+)/', del_mock),  # 删除单元
    path('get_mock/', get_mock),  # 拿到mock数据
    path('mock_set/', mock_set),  # mock单元设置
    re_path('mock_enable/(?P<mid>.+)/', mock_enable),  # 启用单元
    re_path('mock_disable/(?P<mid>.+)/', mock_disable),  # 弃用单元
    #########
    re_path('server_enable/(?P<pid>.+)/', server_enable),  # 启用服务
    re_path('server_disable/(?P<pid>.+)/', server_disable),  # 关闭服务
    ####demo
    path('demo_span/', demo_span),  #  测试转用

]
